package luj.tool.jnproxyan.proxy.network.socksv2.server;

import io.netty.channel.Channel;
import io.netty.util.AttributeKey;

public class ServerStateAttr {

  public ServerStateAttr(Channel channel) {
    _channel = channel;
  }

  public void init(ProxyServerState state) {
    _channel.attr(KEY).set(state);
  }

  public ProxyServerState get() {
    return _channel.attr(KEY).get();
  }

  private static final AttributeKey<ProxyServerState> KEY = AttributeKey.valueOf("proxy.server.global") ;

  private final Channel _channel;
}
